package Final;

import java.util.*;
import java.util.function.BiConsumer;

public class test08 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        CourseManagementSystem cms = new CourseManagementSystem();
        int ops = sc.nextInt();
        for (int i = 0; i < ops; i++) {
            String op = sc.next();
            if (op.equals("add"))
                cms.add(sc.nextInt(), sc.nextInt());
            else if (op.equals("delete"))
                cms.delete(sc.nextInt());
            else if (op.equals("query")) {
                int no = sc.nextInt();
                int s = cms.query(no);
                System.out.println("the score for " + no + " is : " + s);
            }
        }
        cms.statistic();
    }
}

/* 你的代码被嵌在这里*/
class CourseManagementSystem {
    private Map<Integer, Integer> map = new HashMap<>();

    public CourseManagementSystem() {
    }

    void add(int num, int score) {
        if (!map.containsKey(num)) {
            map.put(num, score);
            return;
        }
        if (map.get(num) != null) {
            System.out.println("the student already exists");
            return;
        }
        map.put(num, score);
    }

    void delete(int num) {
        if (!map.containsKey(num)) {
            System.out.println("no such student");
            return;
        }
        map.remove(num);
    }

    int query(int num) {
        return map.get(num);
    }

    void statistic() {
        int a = 0,b = 0, c = 0, d = 0, e = 0;
        for (Map.Entry<Integer,Integer> entry:map.entrySet()){
            int score = entry.getValue();
            if (score >= 0 && score <= 59){
                e++;
            }
            if (score >= 60 && score <= 69){
                d++;
            }
            if (score >= 70 && score <= 79){
                c++;
            }
            if (score >= 80 && score <= 89){
                b++;
            }
            if (score >= 90 && score <= 100){
                a++;
            }
        }
        System.out.println("[0-59] : " + e);
        System.out.println("[60-69] : " + d);
        System.out.println("[70-79] : " + c);
        System.out.println("[80-89] : " + b);
        System.out.println("[90-100] : " + a);
    }
}